import java.util.Random;

public class text25 {
    public static void main(String[] args)
    {
        Random r = new Random();
        int[] arr = new int[10];

        int i = 0;
        for(i = 0; i < 10; i++)
        {
            arr[i] = r.nextInt(19) + 23;
        }
        //求最大值和最小值
        Maxmin(arr);
        //求平均数
        avg(arr);

    }
    public static void Maxmin(int arr[])
    {
        int max = arr[0];
        int min = arr[0];
        for(int i = 0; i < arr.length; i++)
        {
            if(max < arr[i])
                max = arr[i];
            if(min  > arr[i])
                min = arr[i];
        }
        System.out.println("最大值为" + max + "\n最小值为" + min);
    }
    public static void avg(int arr[])
    {
        int sum = 0;
        for(int i = 0; i < arr.length; i++)
        {
            sum += arr[i];
        }
        System.out.println("总和"+ sum +"平均值为" + sum/10.0);
    }
}
